<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/ui-box.css">
    <link rel="stylesheet" href="css/ui-base.css">
	<link rel="stylesheet" href="css/project/ui-input-v3.css">
	<link rel="stylesheet" href="css/zv_common.css">
	<link rel="stylesheet" href="css/project/style.css">
	<link rel="stylesheet" href="css/zv_common.css"> 
	<script src="js/zy_control.js"></script>
	<script src="js/zy_click.js"></script>
	<script src="js/zy_json.js"></script>
	<script src="js/main.js"></script>
	<script src="js/init.js"></script>
    <script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
	<script src="js/talkingdata.js"></script>
</head>
<body class="um-vp ub  ub-ver " ontouchstart>
<div id="page_1" class="ub ub-ver um-vp">	
</div>
 
</body>

<script>
zy_init();
window.uexOnload=function(type){
	if(!type){
		uexWindow.setBounce("0");
		IC.talkingDataCount("旅客信息","0003");
	}
	fly();
}
function fly(){
	IC.talkingDataCount("旅客信息","0003");
	var carrier =localStorage.getItem("fly_zv_carrier"); /*承运人*/
	var flightNo =localStorage.getItem("fly_zv_flightNo");/*航班号*/
	var pdate = localStorage.getItem("fly_zv_pdate");/*日期*/
	var dept =localStorage.getItem("fly_zv_dept");
	var arr =localStorage.getItem("fly_zv_arr");
	var choose =localStorage.getItem("fly_zv_choose");
	if (flightNo == '' || flightNo == null) {
		$alert('航班号不能为空');
		
	}
	else if (flightNo == '' || flightNo == null) {
		$alert('航班号不能为空');
	}
	else if (pdate == ''|| pdate == null) {
		$alert('日期不能为空');
	}
	else if (dept == ''|| dept == null) {
		$alert('起飞城市不能为空');
	}
	else if (arr == '' || arr == null) {
		$alert('降落城市不能为空');
	}
	else if (choose == '' || choose == null) {
		$alert('类型不能为空');
	}
	else {
		Loading(0);	
		localStorage.setItem("carrier",carrier);
		localStorage.setItem("flightNo",flightNo);
		localStorage.setItem("pdate",pdate);
		localStorage.setItem("dept",dept);
		localStorage.setItem("arr",arr);
		var wsdl = Urlpassenger_informaton + "DataService.asmx?wsdl";
		var nameSpace = "http://dcs.ceair.com/";
		var paras = "loginsystem|carrier|flightNo|pdate|dept|arr";
		var values = 'CeaMobile|' + carrier + '|' + flightNo + '|' + pdate + '|' + dept + '|' + arr;
		var method = "QueryOtherCount";
		currentJosn(wsdl,nameSpace,paras,values,method);	
	}
}
function returnjson(currentJosnStr){
	IC.talkingDataCount("旅客信息","0003");
	var obj = strToJson(currentJosnStr);
	var GoldCount=obj[0].GoldCount
	var SilverCount=obj[0].SilverCount
	var CopperCount=obj[0].CopperCount
	if(GoldCount=='0' && SilverCount=='0' && CopperCount=='0')
	{
		localStorage.setItem("state","1");
		var carrier=obj[0].Carrier
		var flightNo=obj[0].FlightNo
		var pdate=obj[0].PDate
		pdate=pdate.replace(/\//g, '-') 
		$.getJSON(host_address_url+"PassengerSoap?RequestKey="+RequestKey+"&+flightNo="+carrier+flightNo+"&date="+pdate+"&URL="+passengers_eclf_url+"ESB/MS/QueryPassInfo",function(json){
			var json=JSON.stringify(json)
			var jsondate = strToJson(json)
			var passengersInfo=jsondate.passengersInfo
			if(passengersInfo!='' && passengersInfo!='null'&& passengersInfo!='undefined'&& passengersInfo!=undefined)
			{
				localStorage.setItem("zvData",json);
				var jsondate = strToJson(json)
				var passengersInfo=jsondate.passengersInfo
				
				var shipmentintPaxF=0
				var shipmentintPaxC=0
				var shipmentintPaxY=0
				var vipTypeGold=0 
				var vipTypeSilver=0 
				var zv_All=0
				var PaxFz=''
				var PaxCz=''
				var PaxYz=''
				var Goldz=''
				var Silverz=''
				for (var i = 0; i < passengersInfo.length; i++) 
				{
					var shipment=passengersInfo[i].shipment
					var Cts = "?" + shipment
					if (Cts.indexOf('F') > 0 || Cts.indexOf('P') > 0 || Cts.indexOf('A') > 0)//头等舱
					{
						if(shipmentintPaxF==0){PaxFz+= passengersInfo[i].registrationInfo}else{PaxFz+= '|'+passengersInfo[i].registrationInfo}
						shipmentintPaxF++
					}
					if (Cts.indexOf('J') > 0 || Cts.indexOf('C') > 0 || Cts.indexOf('D') > 0 || Cts.indexOf('I') > 0 || Cts.indexOf('O') > 0)//公务舱
					{
						if(shipmentintPaxC==0){PaxCz+= passengersInfo[i].registrationInfo}else{PaxCz+= '|'+passengersInfo[i].registrationInfo}
						 shipmentintPaxC++
					}
					if (Cts.indexOf('J') <= 0 && Cts.indexOf('C') <= 0 && Cts.indexOf('D') <= 0 && Cts.indexOf('I') <= 0 && Cts.indexOf('O') <=0 &&Cts.indexOf('F') <= 0 && Cts.indexOf('P') <= 0 && Cts.indexOf('A') <= 0)//经济舱
					{
						if(shipmentintPaxY==0){PaxYz+= passengersInfo[i].registrationInfo}else{PaxYz+= '|'+passengersInfo[i].registrationInfo}
						 shipmentintPaxY++
					}
					var vipType=passengersInfo[i].vipType
					var CtsType = "?" + vipType
					if (CtsType.indexOf('金卡') > 0)//金卡
					{
						if(vipTypeGold==0){Goldz+= passengersInfo[i].registrationInfo}else{Goldz+= '|'+passengersInfo[i].registrationInfo}
						 vipTypeGold++
					}
					if (CtsType.indexOf('银卡') > 0)//银卡
					{
						if(vipTypeSilver==0){Silverz+= passengersInfo[i].registrationInfo}else{Silverz+= '|'+passengersInfo[i].registrationInfo}
						 vipTypeSilver++
					}
					if(i==0){zv_All+= passengersInfo[i].registrationInfo}else{zv_All+= '|'+passengersInfo[i].registrationInfo}
						
				}	
				
				var choose='all'
				
				if(choose=='PaxF')
				{
					if(PaxFz!='')
					{
						localStorage.setItem("MessageId",PaxFz);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html');		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
					
				}
				else if(choose=='PaxC')
				{
					if(PaxCz!='')
					{
						localStorage.setItem("MessageId",PaxCz);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
					
				}
				else if(choose=='PaxY')
				{
					if(PaxYz!='')
					{
						localStorage.setItem("MessageId",PaxYz);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
				}
				else if(choose=='GoldCount')
				{
					if(Goldz!='')
					{
						localStorage.setItem("MessageId",Goldz);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}					
				}
				else if(choose=='SilverCount')
				{
					if(Silverz!='')
					{
						localStorage.setItem("MessageId",Silverz);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
				}
				else if(choose=='all')
				{
					if(zv_All!='')
					{
						localStorage.setItem("MessageId",zv_All);
						Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
				}
				else
				{
					$alert("暂无数据")
					Loading(-1);
				}
				
				
				
			}
			else
			{
				$alert("暂无数据")
				Loading(-1);
			}	
		})
	}
	else{
		localStorage.setItem("state","2");
		var carrier=obj[0].Carrier
		var flightNo=obj[0].FlightNo
		var pdate=obj[0].PDate
		pdate = pdate.split(" ");
		pdate = pdate[0];
		pdate=pdate.replace(/\//g, '-')
		var dept=obj[0].DeptAirport
		var arr=obj[0].ArrAirport
		var wsdl = passengers_all_url
	    var nameSpace = passengers_all_nameSpace
		var paras = "loginsystem|carrier|flightNo|pdate|dept|arr";
		var values = 'CeaMobile|' + carrier + '|' + flightNo + '|' + pdate + '|' + dept + '|' + arr;
		var method = passengers_all_function
		var jsonPage =[{'key':'RequestKey','type':'0','value':RequestKey},{'key':'wsdl','type':'0','value':wsdl},{'key':'KEY1','type':'0','value':'1'},{'key':'KEY2','type':'0','value':'1'}, {'key':'KEY3','type':'0','value':'1'}, {'key':'nameSpace','type':'0','value':nameSpace}, {'key':'method','type':'0','value':method}, {'key':'paras','type':'0','value':paras}, {'key':'values','type':'0','value':values}];
		$.getJSON(UrlClient+"&SOAPType=yes",function(json){
			var json = JSON.stringify(json);
			localStorage.setItem("zvData",json);
			Allpassengers();
			
		},"json",function(e){},"POST",jsonPage,false);
	}
}
///////////////////////////全部旅客查询开始///////////////////////////

function Allpassengers(){
	
	var carrier =localStorage.getItem("fly_zv_carrier"); /*承运人*/
	var flightNo =localStorage.getItem("fly_zv_flightNo");/*航班号*/
	var pdate = localStorage.getItem("fly_zv_pdate");/*日期*/
	var dept = localStorage.getItem("fly_zv_dept");
	var arr =localStorage.getItem("fly_zv_arr");
	var choose =localStorage.getItem("fly_zv_choose");

	var wsdl = passenger_content_url
    var nameSpace = passenger_content_nameSpace
	var paras = "loginsystem|carrier|flightNo|pdate|dept|arr";
	var values = 'CeaMobile|' + carrier + '|' + flightNo + '|' + pdate + '|' + dept + '|' + arr;
	var method = passenger_content_function
	var jsonPage =[{'key':'RequestKey','type':'0','value':RequestKey},{'key':'wsdl','type':'0','value':wsdl},{'key':'KEY1','type':'0','value':'1'},{'key':'KEY2','type':'0','value':'1'}, {'key':'KEY3','type':'0','value':'1'}, {'key':'nameSpace','type':'0','value':nameSpace}, {'key':'method','type':'0','value':method}, {'key':'paras','type':'0','value':paras}, {'key':'values','type':'0','value':values}];
	$.getJSON(UrlClient+"&SOAPType=yes",function(json){
		var choose =localStorage.getItem("fly_zv_choose");
		var JosnStr = JSON.stringify(json);
		localStorage.setItem("zvData",JosnStr);
		var jsondata =strToJson(JosnStr);
		var MessageId = ''
		var z =0
		if(choose=='PaxF')//头等舱
		{
			for (var i = 0; i < jsondata.length; i++) {
				var CabinNo = jsondata[i].CabinNo;
				var CabinNo = CabinNo.substring(CabinNo.length, CabinNo.length - 1);//舱位后一位
				if(CabinNo!='')
				{
					var Cts = "?"+CabinNo
					if (Cts.indexOf('F') > 0 || Cts.indexOf('P') > 0 || Cts.indexOf('A') > 0)//查询判断
					{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
					}
				}
			}
		}
		else if(choose=='PaxC')//公务舱
		{
			for (var i = 0; i < jsondata.length; i++) {
				var CabinNo = jsondata[i].CabinNo;
				var CabinNo = CabinNo.substring(CabinNo.length, CabinNo.length - 1);//舱位后一位
				if(CabinNo!='')
				{
					var Cts = "?"+CabinNo
					if (Cts.indexOf('J') > 0 || Cts.indexOf('C') > 0 || Cts.indexOf('D') > 0 || Cts.indexOf('I') > 0 || Cts.indexOf('O') > 0 )//查询判断
					{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
					}
				}
			}
		}
		else if(choose=='PaxY')//经济舱
		{
			for (var i = 0; i < jsondata.length; i++) {
				var CabinNo = jsondata[i].CabinNo;
				var CabinNo = CabinNo.substring(CabinNo.length, CabinNo.length - 1);//舱位后一位
				if(CabinNo!='')
				{
					var Cts = "?"+CabinNo
					if (Cts.indexOf('J') <= 0 && Cts.indexOf('C') <= 0 && Cts.indexOf('D') <= 0 && Cts.indexOf('I') <= 0 && Cts.indexOf('O') <=0 &&Cts.indexOf('F') <= 0 && Cts.indexOf('P') <= 0 && Cts.indexOf('A') <= 0)//查询判断
					{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
					}
				}
			}
		}
		else if(choose=='SSRCount')//特殊服务
		{
			for (var i = 0; i < jsondata.length; i++) {
				var SSR=jsondata[i].SSR
				if(SSR!='' && SSR!='None')
				{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
				}
			}		
		}
		else if(choose=='SPMLCount')//特殊餐饮
		{
			for (var i = 0; i < jsondata.length; i++) {
				var SPML=jsondata[i].SPML
				if(SPML!='' && SPML!='None')
				{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
				}
			}	
		}
		else if(choose=='GoldCount')//金卡
		{
			for (var i = 0; i < jsondata.length; i++) {
				var FQTV=jsondata[i].FQTV
				if(FQTV!='')
				{
					FQTV = FQTV.split("/");//G
					var Cts = "a"+FQTV[1]
					if (Cts.indexOf('G') > 0)//查询判断
					{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
					}
				}
			}
		}
		else if(choose=='SilverCount')//银卡
		{
			for (var i = 0; i < jsondata.length; i++) {
				var FQTV=jsondata[i].FQTV
				if(FQTV!='')
				{
					FQTV = FQTV.split("/");//G
					var Cts = "a"+FQTV[1]
					if (Cts.indexOf('S') > 0)//查询判断
					{
						if(z==0)
						{
						MessageId+= jsondata[i].MessageId
						}
						else
						{
							MessageId+= '|'+jsondata[i].MessageId
						}
						z++
					}
				}
			}
		}
		else if(choose=='hurry')//登机着急
		{
			var carrier    = localStorage.getItem("fly_zv_carrier");
			var flightNo = localStorage.getItem("fly_zv_flightNo");
			var pdate     = localStorage.getItem("fly_zv_pdate");
			var dept       = localStorage.getItem("fly_zv_dept");
			var arr          = localStorage.getItem("fly_zv_arr");
			$.getJSON(host_address_url+"PassengerInformation?RequestKey="+RequestKey+"&dep_date="+pdate+"&flight_number="+flightNo+"&dep_airport="+dept+"&arr_airport="+arr+"&airline_code="+carrier,function(json){
					var hurryhurry=json
					if(hurryhurry.length>0)
					{
						JosnStr = "{\"data\": {\"items\":"+JosnStr+"}}";
						var json = strToJson(JosnStr);
						for (var v= 0;v< hurryhurry.length; v++) {							
							var seat_id=hurryhurry[v].seat_id
							if(seat_id != "" && seat_id != "undefined" && seat_id != undefined)
							{
								var data = jsonsql.query("select * from json.data.items where (Seat=='"+seat_id+"'  )", json);
								for (var m = 0; m < data.length; m++) {
									if(z==0)
									{
									MessageId+= jsondata[m].MessageId
									}
									else
									{
										MessageId+= '|'+jsondata[m].MessageId
									}
									z++
								}	
							}
						}
						 localStorage.setItem("MessageId",MessageId);
						 Loading(-1);
						openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);	
					}
					else
					{
						$alert("暂无数据")
						Loading(-1);
					}
			})
		}
		else if(choose=='all')
		{
			for (var i = 0; i < jsondata.length; i++) {
				if(z==0)
				{
					MessageId+= jsondata[i].MessageId
				}
				else
				{
					MessageId+= '|'+jsondata[i].MessageId
				}
				z++
			}
		}
		else
		{
			MessageId=''
		}
		if(choose!='hurry')
		{
			if(MessageId=='')
			{
				$alert("暂无数据")	
				Loading(-1); 
			}	
			else
			{
				localStorage.setItem("MessageId",MessageId);
				Loading(-1);
				openNewWin('fly_passenger_information_detail','fly_passenger_information_detail.html',0);		
			}
		}
		 
	},"json",function(e){},"POST",jsonPage,false);
}

</script>
</html>